import React, { Component } from 'react'
import Item from '../Item'
import PropTypes from 'prop-types'
import './index.css'
export default class List extends Component {
  static propTypes = {
    list:PropTypes.array.isRequired
  }
  render() {
    const {list,isFirst,isLoading,err} = this.props
    
    let msg = ''
    if(isFirst){
      msg = '请输入名字搜索.....'
    }
    if(isLoading){
      msg = '正在搜索ing.......'
    }
    if(err){
      msg = err
    }
    return (
        <div className="row">
            <h2>{msg}</h2>
            <Item list={list}/>
        </div>
    )
  }
}
